home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / LGP250S1.ZIP / src / libgplus.5 / libgplus / vms / aaareadm.txt < prev    next >
Text File  |  1992-06-18  |  14KB  |  261 lines

  1.     This directory contains the VMS specific files for libg++.  To 
  2. install, you will need to have both gcc and gxx (C++) already running, and 
  3. you must have write access to the directories that GNU_GXX_INCLUDE:[000000], 
  4. GNU_CC:[000000] and GNU_CC_INCLUDE:[000000] point to.  If you have not figured
  5. it out already, you must run the command file "make-l2.com" in the gcc 2.0
  6. distribution (which creates the library gcclib2.olb), and then you should
  7. extract all of the object modules from this library and add them to
  8. GNU_CC:[000000]GCCLIB.OLB. If you have write access to sys$library,  then the
  9. compiled libgxx_shr.exe will be copied there, and if you have  CMKRNL
  10. privilege, the installation procedure will run INSTALL to make it a  known
  11. image.  If you do not have the correct privileges or write access to 
  12. sys$library, the compiled libgxx_shr.exe will be left in the directory  where
  13. it was built, and the installation procedure will continue.
  14.   The installation procedure will automatically copy all of the header
  15. files from the directory where you unpacked the library to the appropriate
  16. header directory (GNU_GXX_INCLUDE).  To start the installation, simply
  17. type: 
  18.  
  19.     @VMS-INSTALL-LIBGXX
  20.  
  21. and go get a cup of coffee.  (This can be submitted to a batch queue if you 
  22. wish).
  23.  
  24.     For one reason or another, the installation procedure may bomb on 
  25. your system when it is running.  For this reason, I will describe the 
  26. various steps that it takes in order to help you figure out what went wrong.
  27.  
  28.     1) A Unix filesystem is case sensitive with respect to filenames
  29.     while VMS is not case-sensitive.  Thus String.h and string.h appear
  30.     to be two different files under Unix, and would appear the same to 
  31.     VMS.  Unfortunately, there are a couple of cases where two files
  32.     differ only in the case of their names, and when you unpack libg++
  33.     on a VMS system, you are left with two seperate versions of what
  34.     would appear to be the same file.
  35.  
  36.     The installation procedure knows about these cases and attempts to
  37.     rename the offending files by renaming String.h to sstring.h for 
  38.     example.  Next the installation procedure edits any files in the
  39.     distribution that contain references to these header files, and
  40.     changes the include directives to refer to the new names.
  41.  
  42.     This procedure may fail if a new file is added to the distribution
  43.     that has a name that needs to be changed, or if a current or new 
  44.     file includes one of the existing files that was renamed.  In this
  45.     case, you can simply hack the file VMS-INSTALL-LIBGXX.COM to handle
  46.     these new cases.
  47.  
  48.     * Next the install procedure moves all of the header files to 
  49.     GNU_GXX_INCLUDE.  This step is fairly robust, and the only problem
  50.     that could occur is if you run out of disk space/quota.  If there
  51.     are already existing files present in the directory, the install
  52.     procedure copies the new set over the old ones, and you must purge
  53.     the old ones by hand.
  54.  
  55.  
  56.     * Finally, the install procedure will compile the source modules and
  57.     build the library.  In addition, it will automatically move the
  58.     support files into the required directories.  Building the library
  59.     should take several hours.  After all of the compilation is complete
  60.     it will    build a sharable image library, will be moved to sys$library,
  61.     if the account you are running this from has write access to
  62.     sys$library.  It will also move the other files that are required by
  63.     libg++ into the GNU_CC:[000000] directory.
  64.  
  65. After this, you should define the following commands in SYLOGIN.COM:
  66.  
  67. $gxx:==gcc/plus
  68. $genclass:==@gnu_cc:[000000]genclass
  69. $cxlink:==@gnu_cc:[000000]cxlink    !only if using non-shared libraries.
  70. $cxlink:==@gnu_cc:[000000]cxshare    !only if using shared libraries
  71.  
  72. Finally, make sure that GCC_INSTALL.COM is in the system startup file, 
  73. if you have already installed C++, then you have probably already done this.
  74.  
  75.     Once you have built the library itself, you may wish to run the test
  76. suite that is included with libgxx.  To do this you simply need to execute
  77. the command procedure VMS-TEST-LIBGXX.COM, which will compile and link all of the
  78. source modules that are required to run the test.  Once again, you should
  79. expect this to take several hours. It will create a file RUN.COM, which can be
  80. submitted to a batch queue, and you can compare the output to the file
  81. EXPECTED.VMS
  82.  
  83.       There is one bit of oddness which is that programs running under
  84. batch have spurious line breaks in the output if you use
  85. cout << (anything).  This is due to the
  86. fact that the implementation of write in the VAX-C run time library inserts a
  87. line break whenever a 512 byte buffer fills up.  If you are running
  88. interactively then the output will appear normally.  If you use the $assign
  89. command to redirect sys$output to a file, or if you use sethost/log to
  90. try to capture the output, you will get the spurious line breaks.
  91. At some point in the future, I may add some kind of primative I/O
  92. routines that will only be used internally by libg++, which should work a
  93. lot better than the brain-dead version in the VAX-C run time library.
  94.  
  95. The files included in this directory are:
  96.  
  97. AAAREADME.TXT    This file.
  98. CXLINK.COM    Command file to link to the non-shared library.
  99. CXSHARE.COM    Command file to link to the shared version of the library.
  100. EXPECTED.LIST    List of the executables to be run to generate EXPECTED.VMS
  101.         Used by VMS-TEST-LIBGXX.COM to generate RUN.COM
  102. EXPECTED.VMS    Expected output from the test suite.  Execute command file
  103.         VMS-TEST-LIBGXX, and then the file RUN.COM that is generated, and
  104.         compare the output to this file.
  105. FNDVEC.C    Source file to a program that will automatically generate
  106.         LIBGXX_VECTOR.C, the list of all of the transfer vectors.
  107. GENCLASS.COM    Command file to generate container classes.
  108. GENCLASS.TPU    TPU code called by GENCLASS.COM
  109. GXX_MAIN_SHR.MAR
  110.         This does not contain any routines, but it does contain a
  111.         couple of psect definitions that are used by __MAIN to locate
  112.         any global objects in the sharable libg++, and initialize them.
  113. OPTIONS.OPT    Options file used when linking to the non-shared library.
  114. VMS-BUILD-LIBGXX.COM
  115.         Command file that actually does the dirty work of building the
  116.         library.
  117. VMS-CURSES.C    A couple of routines that are needed by the curses module
  118.         in libg++.
  119. VMS-GCCLIB.MAR    Source to the modified version of module GCCLIB in library
  120.         GCCLIB.OLB
  121. VMS-INSTALL-LIBGXX.COM
  122.         This command file builds the actual library, and moves any
  123.         assorted files required by libg++ to the correct directory.
  124.         This is not idiot proof, so beware.  It will delete the obj's
  125.         after it is finished, and leave behind the lib.
  126. VMS-TEST-LIBGXX.COM    Command file to build the test suite and create RUN.COM
  127. VMS_FIXINCLUDES.TPU
  128.         This file is used to fix include directives that refer to files
  129.         such as String.h (when there is also a string.h).
  130.  
  131. ************************************************
  132. A few comments are in order.
  133.  
  134.     1) I strongly recommend that you use the sharable library if at all
  135. possible. (See note 4 below) This is really quite painless.  This is created by
  136. default when you execute @LIBGXX_INSTALL.  If you want to get the optimum
  137. performance, and you expect a lot of people to use libg++, you have the option
  138. of installing LIBGXX_SHR.EXE. Obviously, there are no special privileges
  139. required for the image.  
  140.  
  141.     2) If you get warning messages from the assembler about g++ making
  142. references to __vt.* as a routine, ignore them.  There is a bug in the g++ 
  143. compiler, but the assembler catches them and fixes it before anything bad 
  144. happens.
  145.  
  146.     Also, the assembler, gas, has been patched to automatically do a
  147. globaldef/globalref for all vtables.  These are special variables that are
  148. used internally by g++, and the names always begin with "_vt.".  By doing
  149. this, the object code generated from c++ programs will tend to work better
  150. (although not perfectly) with the VMS librarian and the VMS linker.
  151. See note 4 for more information.
  152.  
  153.     3) You should have the proper versions of both the compiler and
  154. assembler in order to use this version of libg++.  In addition, there may be
  155. times when there are patches to the compiler and/or the assembler which have
  156. not made it into the distribution version.  In the past, executables have been
  157. made available via anonymous FTP from mango.miami.edu, which have the proper
  158. patches.
  159.  
  160.     4) Using the non-sharable version of the library is fairly risky.
  161. The problem is that the VMS linker will only pull an object module out of
  162. the library if it needs a procedure from that module.  If the module 
  163. contains an initialized variable, or uses a global constructor to 
  164. initialize a variable, the module might not get pulled in, and you could
  165. get very puzzling results indeed.  I do want to point out that the g++ 
  166. compiler does not use inline functions when compiling with /nooptimize,
  167. and instead generates function calls.  Thus you may find that if you
  168. compile with /nooptimize the program works (because the linker does need
  169. a routine from a module that defines some data), and it fails when compiled
  170. with /optimize (because the compiler has inlined the functions).
  171.  
  172.     As it stands with the 2.0 release, there are two modules in the
  173. iostream portion of libg++ which do not have any entry points at all.  
  174. Unfortunately, these two modules contain the initialized structures for the
  175. variables cout, cin, and cerr.  If you really insist upon using the non-
  176. sharable library, you will have to pull these out of the library, and
  177. always include them explicitly to the linker.  The modules that you
  178. need are STDSTRBUFS and STDSTREAMS.
  179.  
  180.     The sharable library does not have any of these sorts of problems
  181. because all modules are automatically linked into the image.
  182.  
  183.     5) If you create your own libraries, you need to be *very* aware of
  184. the problems outlined in note 4 above.  The suggested remedy is to make
  185. use of the GLOBALREF and GLOBALDEF macros defined in gnu_hacks.h.  All you
  186. need to do is place a GLOBALDEF in any source module that contains 
  187. initialized data or a global object that will be constructed, and place
  188. a GLOBALREF in the header file that you use to declare those objects/
  189. variables as being external.  When you do this, the object modules will
  190. have special symbol references and definitions which the linker will use
  191. to pull the appropriate modules out of the library.
  192.  
  193.     It would be fairly easy to hack the file VMS-BUILD-LIBGXX.COM to
  194. build a sharable image library for your own applications.  If you do this, 
  195. and you wish to use your library with libg++, it might be easiest to
  196. modify VMS-BUILD-LIBGXX.COM merge your library with libg++ before fndvec
  197. is compiled and run.  The build procedure will automatically pick up any
  198. all of your entry points and do the right thing.  If you want to build
  199. a sharable library from your own library, you can hack VMS_BUILD_LIBGXX.COM
  200. to do the job with a very minimal amount of work.
  201.  
  202.     6) As far as I can tell the curses module works, however I am no expert
  203. on curses.  If someone finds something that does not seem to work quite right
  204. let me know.  Keep in mind that you are interfacing to VAXCCURSES, and you are
  205. stuck with all of the idiosyncrasies that it has.  Currently the tCurses
  206. program does not run perfectly, since the prompts do not appear on the screen.
  207.  
  208.     7) In chapter 6 of the libg++ manual there is a description of what
  209. are called the "container class prototypes".  These are classes that can be
  210. made for any type of data object.  The way that this is done now, is to
  211. use a simple text substitution to fill in data types where required.  The
  212. prototype files are in the GNU_GXX_INCLUDE:[GEN] directory, and they
  213. have extensions .HP and .CCP.  The GENCLASS command can be used to generate
  214. the classes, where GENCLASS is defined as:
  215.  
  216. $genclass:==@gnu_cc:[000000]genclass
  217.  
  218. The command syntax is identical to that given in the libg++ manual (except that
  219. the data type should be quoted).  If there is one data type, then the syntax is:
  220.  
  221. $genclass "var" mode class
  222.  
  223. where var is the data type (quoted to preserve case). mode is either REF or
  224. VAL, and class is the name of the container class.  For a class with two data
  225. types, the syntax is 
  226.  
  227. $genclass -2 "var1" mode1 "var2" mode2 class
  228.  
  229. GENCLASS puts the output files in the current default directory.
  230.  
  231.     You should be aware that the g++ compiler does not use inline 
  232. functions when the /NOOPTIMIZE switch is used.  The principal advatage of 
  233. this is that the compiler runs much faster, making it easier to debug
  234. and develop your programs.
  235.  
  236.  
  237.     Any programs that were linked to the old sharable libg++ will not work
  238. with the new libg++, since so many things have changed.  You should 
  239. recompile and relink any such programs.  Also, any programs linked to the 
  240. libg++ 2.0 sharable library will need to be relinked.
  241.  
  242.     The installation procedure is more robust, and more automatic,
  243. which should in principle mean that there will be less maintainance required
  244. for the VMS  port.  The general idea is that for the time being, you
  245. will always have to relink any program linked to the sharable image library
  246. each time you upgrade libg++.  The reason for this is that it is a lot of 
  247. work trying to keep track of which entry points were used for what and so 
  248. forth  (also that the library has been rapidly changing as bugs are fixed
  249. and new methods added).  The fndvec.c program can keep track of some of
  250. this, but if modules or objects change names, then this can get thrown off.
  251.  
  252.     You *may* wish to keep the old sharable libgxx libraries, 
  253. especially if you have programs linked to the old library.
  254.  
  255.                                 6/2/92
  256.                         Eric Youngdale
  257.                         youngdale@v6550c.nrl.navy.mil
  258.  
  259.  
  260. ***************************************************************************
  261.